package com.wofish.member.service.impl;

import com.wofish.common.core.text.Convert;
import com.wofish.member.domain.MemberAccount;
import com.wofish.member.mapper.MemberAccountMapper;
import com.wofish.member.service.IMemberAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 会员登录账号 服务层实现
 * 
 * @author wofish
 * @date 2019-04-21
 */
@Service
public class MemberAccountServiceImpl implements IMemberAccountService {
	@Autowired
	private MemberAccountMapper memberAccountMapper;

	/**
     * 查询会员登录账号信息
     * 
     * @param memberId 会员登录账号ID
     * @return 会员登录账号信息
     */
    @Override
	public MemberAccount selectMemberAccountById(Long memberId) {
	    return memberAccountMapper.selectMemberAccountById(memberId);
	}
	
	/**
     * 查询会员登录账号列表
     * 
     * @param memberAccount 会员登录账号信息
     * @return 会员登录账号集合
     */
	@Override
	public List<MemberAccount> selectMemberAccountList(MemberAccount memberAccount) {
	    return memberAccountMapper.selectMemberAccountList(memberAccount);
	}
	
    /**
     * 新增会员登录账号
     * 
     * @param memberAccount 会员登录账号信息
     * @return 结果
     */
	@Override
	public int insertMemberAccount(MemberAccount memberAccount) {
	    return memberAccountMapper.insertMemberAccount(memberAccount);
	}
	
	/**
     * 修改会员登录账号
     * 
     * @param memberAccount 会员登录账号信息
     * @return 结果
     */
	@Override
	public int updateMemberAccount(MemberAccount memberAccount) {
	    return memberAccountMapper.updateMemberAccount(memberAccount);
	}

	/**
     * 删除会员登录账号对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteMemberAccountByIds(String ids) {
		return memberAccountMapper.deleteMemberAccountByIds(Convert.toStrArray(ids));
	}
	
}
